package com.spirit.mypopup.menu;

import androidx.annotation.Nullable;

/**
 * author : fang.zhang
 * e-mail : initzf@126.com
 * date   : 2020/5/16
 * desc   :
 */
public class OptionTitleObject implements OptionTitleInterface {

    private String title;

    public OptionTitleObject(String title) {
        this.title = title;
    }

    @Override
    public String getTitle() {
        return title;
    }

    @Override
    public String getValue() {
        return title;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof OptionTitleObject)) return false;

        OptionTitleObject that = (OptionTitleObject) o;

        return getTitle() != null ? getTitle().equals(that.getTitle()) : that.getTitle() == null;
    }

    @Override
    public int hashCode() {
        return getTitle() != null ? getTitle().hashCode() : 0;
    }
}
